//
//  NEDRouter+Map.h
//  NEDRouter
//
//  Created by 98du on 2021/12/1.
//

#import "NEDRouter.h"
#import "UIViewController+NEDRouter.h"
#import <NEDConstant/NEDConstant.h>

NS_ASSUME_NONNULL_BEGIN

@interface NEDRouter (Map)


/// MARK: - Bifrost

/// Bifrost ： 在需要被跳转的控制器中 +load 中设置
/// @param key 最好 module+classname
/// @param handler 参数信息
+ (void)ned_bindKey:(nonnull NSString *)key
           vcClass:(Class)vcClass
         toHandler:(nonnull _Nullable id (^)(NSDictionary * _Nullable parameters))handler;

+ (nullable UIViewController *)ned_handleKey:(nonnull NSString *)key;

+ (nullable UIViewController *)ned_handleKey:(nonnull NSString *)key
                                     params:(nullable NSDictionary*)params;


/// MARK: - key

/// 添加控制跳转的Map映射 在需要映射的控制器中的 load 设置
/// 数组中的元素可以是字符串或者整形：@[@"home",@"main",@(1),@"1"]
+ (void)ned_bindKeys:(nonnull NSArray *)keys vcClass:(Class)vcClass;
+ (void)ned_bindKey:(nonnull NSString *)key vcClass:(Class)vcClass;
+ (void)ned_bindKeys:(nonnull NSArray *)keys vcClassName:(NSString *)vcClassName;
+ (void)ned_bindKey:(nonnull NSString *)key vcClassName:(NSString *)vcClassName;

/// 绑定
+ (void)ned_bindKey:(nonnull NSString *)key handle:(NEDRouterHandleBlock)handle;

/// 通过Key获取map对应的控制器
+ (UIViewController *)ned_controllerKey:(NSString *)key;

@end

NS_ASSUME_NONNULL_END
